#include <dlfcn.h>

void *builtin_frame_address(int i)
{
	switch (i)
	{
		case 0:
			return __builtin_frame_address(0);
		case 1:
			return __builtin_frame_address(1);
		case 2:
			return __builtin_frame_address(2);
		case 3:
			return __builtin_frame_address(3);
		case 4:
			return __builtin_frame_address(4);
		case 5:
			return __builtin_frame_address(5);
		case 6:
			return __builtin_frame_address(6);
		case 7:
			return __builtin_frame_address(7);
		case 8:
			return __builtin_frame_address(8);
		case 9:
			return __builtin_frame_address(9);
		case 10:
			return __builtin_frame_address(10);
		case 11:
			return __builtin_frame_address(11);
		case 12:
			return __builtin_frame_address(12);
		case 13:
			return __builtin_frame_address(13);
		case 14:
			return __builtin_frame_address(14);
		case 15:
			return __builtin_frame_address(15);
		default:
			return NULL;
	}
}

void *builtin_return_address(int i)
{
	switch(i)
	{
		case 0:
			return __builtin_return_address(0);
		case 1:
			return __builtin_return_address(1);
		case 2:
			return __builtin_return_address(2);
		case 3:
			return __builtin_return_address(3);
		case 4:
			return __builtin_return_address(4);
		case 5:
			return __builtin_return_address(5);
		case 6:
			return __builtin_return_address(6);
		case 7:
			return __builtin_return_address(7);
		case 8:
			return __builtin_return_address(8);
		case 9:
			return __builtin_return_address(9);
		case 10:
			return __builtin_return_address(10);
		case 11:
			return __builtin_return_address(11);
		case 12:
			return __builtin_return_address(12);
		case 13:
			return __builtin_return_address(13);
		case 14:
			return __builtin_return_address(14);
		case 15:
			return __builtin_return_address(15);
		default:
			return NULL;
	}
}


